package com.neu.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.neu.base.BaseEntity;
import com.neu.utils.excel.EasyExcelConvert;
import com.neu.utils.excel.EnumFiledConvert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Schema(description = "租户实体")
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tenant")
public class Tenant extends BaseEntity {
    /**
     * 租户ID
     */
    @TableId(type= IdType.ASSIGN_ID)
    @ExcelProperty(value = "租户ID")
    private String tenantId;
    /**
     * 租户名称
     */
    @ExcelProperty("租户名称")
    private String tenantName;

    /**
     * 租户域名
     */
    @ExcelProperty("租户域名")
    private String domain;
    /**
     * 租户联系人id
     */
    @ExcelIgnore
    private String contactId;
    /**
     * 租户logo
     */
    @ExcelIgnore
    private String logo;
    /**
     * 权益 1 普通租户  0 系统租户
     */
    @ExcelProperty(value = "权益",converter = EasyExcelConvert.class)
    @EnumFiledConvert(enumMap = "1|普通租户,0|系统租户")
    private String rights;
    /**
     * 到期时间
     */
    @ExcelProperty("到期时间")
    private LocalDateTime expireTime;
    /**
     * 备注
     */
    @ExcelProperty("备注")
    private String remark;
}
